<?php
/**
 * 功能描述：	系统主页
 * @datetime	2022-07-07
 * @version   	v2.3
 * @author   	ZHL
 * @copyrigh  	2022 ZHL 版权所有
 */

class Admin_IndexModel extends Model {

    /**
     * Notes: 获取时间段登录日志
     * User: ZhuHaili
     */
    public function getUserLoginLogList($startDate, $endDate){
        $sql['field'] = 'id,user_id,title,user_mobile,user_email,ip,createdate';
        $sql['table'] = 'syslog_login';
        $sql['where']['status'] = '2';
        $sql['gts']['createdate'] = $startDate;
        $sql['lts']['createdate'] = $endDate;
        $sql['order'] = 'createdate desc';
        $db = $this->conn('mysql');
        $list = $db->select($sql);
        return $list;
    }

    /**
     * Notes: 获取时间段操作日志
     * User: ZhuHaili
     */
    public function getUserOperateLogList($startDate, $endDate){
        $sql['field'] = 'id,user_id,title,mould_code,menu_id,menu_name,essay_id,content,types,createdate';
        $sql['table'] = 'syslog_act';
        $sql['where']['status'] = '2';
        $sql['gts']['createdate'] = $startDate;
        $sql['lts']['createdate'] = $endDate;
        $sql['order'] = 'createdate desc';
        $db = $this->conn('mysql');
        $list = $db->select($sql);
        return $list;
    }
}